<template>
  <div class="addDs">
    <!-- 基本数据配置 -->
    <AddDataDS v-if=" current ==0" ref="addDsref" :drawer="drawer" :form="form"></AddDataDS>
    <!-- 处理各个分析类型 -->
    <analyse-type v-if=" current == 1" :form="form"></analyse-type>
    <!-- 筛选字段 -->
    <filter-field v-if=" current == 2 && form.type !==0" :drawer="drawer" :filterForm="form"></filter-field>
    <!-- 漏斗分析输出字段 -->
    <funnel-output v-if=" current == 3 && form.type ==2" :drawer="drawer" :outputForm="form"></funnel-output>
    <!-- 事件分析输出字段 -->
    <output-field v-if=" current == 3 && form.type ==1" :drawer="drawer" :outputForm="form"></output-field>
    <!-- 自定义sql筛选字段 -->
    <query-filter v-if=" current == 2 && form.type ==0" :drawer="drawer" :queryForm="form"></query-filter>
    <!-- 自定义sql输出字段 -->
    <query-output v-if=" current == 3 && form.type ==0" :drawer="drawer" :queryForm="form"></query-output>
    <!-- 路径分析没有输出字段 -->
    <no-output-field v-if="current == 3 && form.type == 3"></no-output-field>
    <!-- 留存分析没有输出字段 -->
    <no-output-field v-if="current == 3 && form.type == 4"></no-output-field>
  </div>
</template>

<script>
import AddDataDS from './components/addDataDS.vue';
import AnalyseType from './components/analyseType.vue';
import FilterField from './components/filterField.vue';
import OutputField from './components/outputField.vue';
import QueryFilter from '../sqlQuery/components/query_filter.vue';
import QueryOutput from '../sqlQuery/components/query_output.vue';
import noOutputField from './components/no_outputField/index.vue';
import funnelOutput from './components/funnel_output/index.vue'
import bus from '../../../components/bus';
  export default {
    props:['current', "drawer", "form"],
    components:{
      AddDataDS,
      AnalyseType,
      FilterField,
      OutputField,
      QueryFilter,
      QueryOutput,
      noOutputField,
      funnelOutput
    },
    watch:{
      current (val) {
      }
    },
    data() {
      return {
        
      }
    },
    computed: {},
    methods: {

    },
    mounted () {
      bus.$on('rulesForm',context => {
        this.$refs.addDsref && this.$refs.addDsref.onRulesForm()
      })
    }
  }
</script>

<style scoped>
.addDs {
  height: 100%;
}
</style>